/* 重置默认样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    width: 320px;
    min-height: 240px;
    max-height: 600px;
    overflow-y: auto;
    background-color: #f8f9fa;
    color: #333;
    padding: 16px;
}

/* 标题样式 */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eaeaea;
}

.header h1 {
    font-size: 18px;
    font-weight: 500;
    color: #1a73e8;
}

.header-actions {
    display: flex;
    gap: 8px;
}

/* 按钮样式 */
button {
    background-color: #1a73e8;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

button:hover {
    background-color: #0d47a1;
}

button.secondary {
    background-color: #f1f3f4;
    color: #1a73e8;
    border: 1px solid #dadce0;
}

button.secondary:hover {
    background-color: #e8eaed;
}

button:disabled {
    background-color: #dadce0;
    color: #5f6368;
    cursor: not-allowed;
}

button.icon-button {
    padding: 4px 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

button.copy-button {
    padding: 6px 10px;
    background-color: #f1f3f4;
    color: #1a73e8;
    font-size: 13px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 5px;
}

button.copy-button:hover {
    background-color: #e8eaed;
}

button.settings-button {
    background-color: transparent;
    color: #5f6368;
    padding: 4px;
}

button.settings-button:hover {
    background-color: #f1f3f4;
}

/* 消息和提示样式 */
.message {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}

.error {
    background-color: #fdeded;
    color: #b71c1c;
    border: 1px solid #f5c2c7;
}

.warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.info {
    background-color: #cfe2ff;
    color: #084298;
    border: 1px solid #b6d4fe;
}

/* 加载指示器 */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 0;
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border-left-color: #1a73e8;
    animation: spin 1s linear infinite;
    margin-bottom: 12px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 卡片样式 */
.codes-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.code-card {
    background-color: white;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid #dadce0;
}

.code-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
}

/* 卡片头部样式 - 包含图标和站点名称 */
.card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

/* 站点行样式 */
.site-row {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

/* 站点图标样式 */
.site-icon {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    background-color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #757575;
    font-size: 12px;
    flex-shrink: 0;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

.site-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.site-name {
    font-size: 14px;
    font-weight: 500;
    color: #202124;
    margin-left: 8px;
}

.site-name a {
    color: #202124;
    text-decoration: none;
}

.site-name a:hover {
    text-decoration: underline;
    color: #1a73e8;
}

.code-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    background-color: #f8f9fa;
    padding: 8px 12px;
    border-radius: 6px;
}

.totp-code {
    font-family: 'Courier New', monospace;
    font-size: 22px;
    font-weight: bold;
    letter-spacing: 2px;
    color: #1a73e8;
}

/* 进度条样式 */
.progress-container {
    margin-top: 5px;
    position: relative;
}

.progress-bar {
    height: 4px;
    background-color: #4caf50;
    border-radius: 2px;
    transition: width 1s linear, background-color 0.5s ease;
}

.time-text {
    font-size: 12px;
    color: #5f6368;
    text-align: right;
    margin-bottom: 4px;
}

/* 空状态样式 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    text-align: center;
}

.empty-state p {
    color: #5f6368;
    font-size: 14px;
    margin-bottom: 16px;
}

/* 通知样式 */
.notification {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #323232;
    color: white;
    padding: 10px 16px;
    border-radius: 4px;
    font-size: 14px;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

.notification.show {
    opacity: 1;
}

/* 复制按钮美化 */
.copy-button {
    background-color: #1a73e8;
    color: white;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.copy-button:hover {
    background-color: #0d47a1;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* 响应式调整 */
@media (max-width: 340px) {
    body {
        width: 280px;
        padding: 12px;
    }
    
    .header h1 {
        font-size: 16px;
    }
    
    button {
        padding: 6px 10px;
        font-size: 13px;
    }
} 